package com.google.denta.ws;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * @author Andrei_Slizhykau
 */
@Path("/test")
public class TestWS {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getMessage() {
        return "RESTful Web Service";
    }

    @GET
    @Produces(MediaType.TEXT_HTML)
    public String getMessageHtml() {
        return "<html><body><p>RESTful Web Service <b>HTML</b></p></body></html>";
    }

    @GET
    @Path("/{id}")
    @Produces(MediaType.TEXT_PLAIN)
    public String getMessage0(@PathParam("id") String id) {
        return "RESTful Web Service "+id;
    }

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public String getJSONMessage() {
        //javax.ws.rs.
        return "{\"id\" : 123 }";
    }    
} // class
